import api from '../api'
import settings from '~/conf/settings'

const state = {

}


const getters = {

}

const actions = {

  //加上餐馆统计


  bistroStaticDay({commit, dispatch}, params) {
    return api.get(api.url('bistroStaticDay'), params)
  },

  bistroStaticMonth({commit, dispatch}, params) {
    return api.get(api.url('bistroStaticMonth'), params)
  },


  //商品的

  productList({commit, dispatch}, params) {
    return api.get(api.url('productList'), params)
  },

  createProduct({commit, dispatch}, params) {
    return api.post(api.url('createProduct'), params)
  },

  productDetail({commit, dispatch}, params) {
    return api.get(api.url('productDetail', params.id))
  },

  productEdit({commit, dispatch}, params) {
    return api.put(api.url('productEdit', params.id), params)
  },

  productDelete({commit, dispatch}, params) {
    return api.delete(api.url('productDelete', params.id))
  },

  staticProductDay({commit, dispatch}, params) {
    return api.get(api.url('staticProductDay'), params)
  },

  staticProductMonth({commit, dispatch}, params) {
    return api.get(api.url('staticProductMonth'), params)
  }

}

const mutations = {

}

export default {
  state,
  getters,
  actions,
  mutations
}
